package com.cgw.dmplt.address.dao.ibatis;

import java.util.List;
import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;
import com.cgw.dmplt.address.domain.CityArea;
import com.cgw.dmplt.address.dao.CityAreaDao;

/**
 *
 */
public class CityAreaDaoImpl extends SqlMapClientDaoSupport implements CityAreaDao
{
    
    /**
     * insert.
     * @param CityArea CityArea
     * @return id
     * 
     */
    public String insertCityArea(CityArea cityArea) {
    	getSqlMapClientTemplate().insert("CityArea_insertCityArea", cityArea);
    	return null;
    }

    /**
     * delete.
     * @param CityArea CityArea
     * 
     */
    public void deleteCityArea(CityArea cityArea){
        getSqlMapClientTemplate().update("CityArea_deleteCityArea", cityArea);
    }
    
    /**
     * update.
     * @param CityArea CityArea
     * 
     */
    public void updateCityArea(CityArea cityArea) {
    	getSqlMapClientTemplate().update("CityArea_updateCityArea", cityArea);
    }
    
    /**
     * find.
     * @param id id
     * @return CityArea
     * 
     */
    public CityArea findCityArea(Integer pk) {
        CityArea CityArea = (CityArea) getSqlMapClientTemplate().queryForObject("CityArea_findCityArea", pk);
        return CityArea;
    }
    
    public List findCityAreaRoot(String pk) {
        List list =   getSqlMapClientTemplate().queryForList("CityArea_findCityArea", pk);
        return list;
    }
    
    /**
     * list.
     * @param CityArea CityArea
     * @return CityArea list
     * 
     */
    public List listCityArea(CityArea cityArea) {
        List list = getSqlMapClientTemplate().queryForList("CityArea_listCityArea", cityArea);
        return list;
    }  
    
    /**
     * listCount.
     * @param CityArea CityArea
     * @return list count
     * 
     */
    public Integer listCityAreaCount(CityArea cityArea) {
        Integer count = (Integer)getSqlMapClientTemplate().queryForObject("CityArea_listCityAreaCount", cityArea);
        return count;
    }
}
